using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Text;

namespace Data.Abstract
{
    public abstract class BaseSqlObject<T> : BaseObject<T>,IDisposable where T : BaseSimple, new()
    {
        SqlConnection _Conn;
		public SqlConnection Connection{
			get{return _Conn;}
			set{_Conn = value;}
		}

        protected new BaseSqlDal Dal
        {
            get { return (BaseSqlDal)_Dal; }
            set { _Dal = value; }
        }

		public BaseSqlObject():base(){}
        public BaseSqlObject(SqlConnection Conn)
            : base()
        {
            this.Connection = Conn;
        }
        

        public new BaseSqlObject<T> Load(T Simple)
        {
            this._Simple = Simple;
            return this;
        }

        #region IDisposable Members

        public void Dispose()
        {
            if (Dal != null) Dal.Dispose();
        }

        #endregion
    }
}
